inspector: Work with new search entry
authorMatthias Clasen <mclasen@redhat.com>
Sun, 17 Feb 2019 04:58:54 +0000 (23:58 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 19 Feb 2019 05:25:59 +0000 (00:25 -0500)
Don't assume a search entry is an entry, and
use the editable api as far as possible.

gtk/inspector/object-tree.c
gtk/inspector/prop-list.c
gtk/inspector/resource-list.c
gtk/inspector/statistics.c

index f2a2f13e1b93a675c2553158d854ab4c30fe4424..618cf0866fd16ecc0e96cf2e4c968610fada0e40 100644 (file)
@@ -916,7 +916,7 @@ search (GtkInspectorObjectTree *wt,
   guint i, selected, n, row;
   const char *text;
 
-  text = gtk_entry_get_text (GTK_ENTRY (priv->search_entry));
+  text = gtk_editable_get_text (GTK_EDITABLE (priv->search_entry));
   if (gtk_list_box_get_selected_row (priv->list))
     {
       selected = gtk_list_box_row_get_index (gtk_list_box_get_selected_row (priv->list));
@@ -998,7 +998,7 @@ static void
 stop_search (GtkWidget              *entry,
              GtkInspectorObjectTree *wt)
 {
-  gtk_entry_set_text (GTK_ENTRY (wt->priv->search_entry), "");
+  gtk_editable_set_text (GTK_EDITABLE (wt->priv->search_entry), "");
   gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (wt->priv->search_bar), FALSE);
 }
 
@@ -1155,7 +1155,7 @@ gtk_inspector_object_tree_init (GtkInspectorObjectTree *wt)
   gtk_widget_init_template (GTK_WIDGET (wt));
 
   gtk_search_bar_connect_entry (GTK_SEARCH_BAR (wt->priv->search_bar),
-                                GTK_ENTRY (wt->priv->search_entry));
+                                GTK_EDITABLE (wt->priv->search_entry));
 
   root_model = create_root_model ();
   wt->priv->tree_model = gtk_tree_list_model_new (FALSE,
index 87aa1d75486f992f117083f46b1ac4d93df5e493..d12a97bd7e0abdbc3547bd45d97e2e05c3f49630 100644 (file)
@@ -79,7 +79,7 @@ static void
 search_close_clicked (GtkWidget            *button,
                       GtkInspectorPropList *pl)
 {
-  gtk_entry_set_text (GTK_ENTRY (pl->priv->search_entry), "");
+  gtk_editable_set_text (GTK_EDITABLE (pl->priv->search_entry), "");
   gtk_stack_set_visible_child_name (GTK_STACK (pl->priv->search_stack), "title");
 }
 
@@ -275,7 +275,7 @@ constructed (GObject *object)
   pl->priv->search_stack = gtk_widget_get_parent (pl->priv->search_entry);
 
   gtk_tree_view_set_search_entry (GTK_TREE_VIEW (pl->priv->tree),
-                                  GTK_ENTRY (pl->priv->search_entry));
+                                  GTK_EDITABLE (pl->priv->search_entry));
 
   g_signal_connect (pl->priv->search_entry, "stop-search",
                     G_CALLBACK (search_close_clicked), pl);
@@ -525,7 +525,7 @@ gtk_inspector_prop_list_set_object (GtkInspectorPropList *pl,
 
   cleanup_object (pl);
 
-  gtk_entry_set_text (GTK_ENTRY (pl->priv->search_entry), "");
+  gtk_editable_set_text (GTK_EDITABLE (pl->priv->search_entry), "");
   gtk_stack_set_visible_child_name (GTK_STACK (pl->priv->search_stack), "title");
 
   if (pl->priv->child_properties)
index 78e116a9923a56b7212da4a876a62b32427c9235..b1d99223fdc6e99e6a9db746650fa60e21877144 100644 (file)
@@ -548,7 +548,7 @@ match_row (GtkTreeModel *model,
   const gchar *text;
   gboolean match;
 
-  text = gtk_entry_get_text (GTK_ENTRY (sl->priv->search_entry));
+  text = gtk_editable_get_text (GTK_EDITABLE (sl->priv->search_entry));
   gtk_tree_model_get (model, iter,
                       COLUMN_NAME, &name,
                       COLUMN_PATH, &path,
@@ -622,7 +622,7 @@ gtk_inspector_resource_list_init (GtkInspectorResourceList *sl)
   g_signal_connect (sl, "map", G_CALLBACK (on_map), NULL);
 
   gtk_search_bar_connect_entry (GTK_SEARCH_BAR (sl->priv->search_bar),
-                                GTK_ENTRY (sl->priv->search_entry));
+                                GTK_EDITABLE (sl->priv->search_entry));
 
   g_signal_connect (sl->priv->search_bar, "notify::search-mode-enabled",
                     G_CALLBACK (search_mode_changed), sl);
index ad988be72f0205ed33d7bc1678e2e538d403e7a9..e975c45db654c5bc9b7cac7887eac234fe39d15e 100644 (file)
@@ -374,7 +374,7 @@ gtk_inspector_statistics_init (GtkInspectorStatistics *sl)
                                       GINT_TO_POINTER (COLUMN_CUMULATIVE2), NULL);
   sl->priv->counts = g_hash_table_new_full (NULL, NULL, NULL, type_data_free);
 
-  gtk_tree_view_set_search_entry (sl->priv->view, GTK_ENTRY (sl->priv->search_entry));
+  gtk_tree_view_set_search_entry (sl->priv->view, GTK_EDITABLE (sl->priv->search_entry));
   gtk_tree_view_set_search_equal_func (sl->priv->view, match_row, sl, NULL);
   g_signal_connect (sl, "hierarchy-changed", G_CALLBACK (hierarchy_changed), NULL);
 }